import QtQuick 2.9
import QtQuick.Controls 2.3

Item{
    id:root
    property color borderColor:"white"
    property int borderWidth: 2

    property alias midItem:mid

    Component.onCompleted: {
        root.borderWidth = 1
    }

    Rectangle{
        anchors{
            left: root.left
            top:root.top
        }
        width:borderWidth
        height: root.height
        color: borderColor
    }
    Rectangle{
        anchors{
            right: root.right
            top:root.top
        }
        width:borderWidth
        height: root.height
        color: borderColor
    }

    Rectangle{
        anchors{
            left: root.left
            top:root.top
        }
        width:root.width
        height: borderWidth
        color: borderColor
    }

    Rectangle{
        anchors{
            left: root.left
            bottom: root.bottom
        }
        width:root.width
        height: borderWidth
        color: borderColor
    }

    Item{
        id:mid
        width: root.width-2*borderWidth
        height:root.height-2*borderWidth
        anchors.centerIn: root
    }
}
